
#include <scott/SSimpleValue.h>
#include <scott/SByte.h>
#include <scott/SChar.h>
#include <scott/SString.h>
#include <scott/SNumber.h>

BOOST_AUTO_TEST_SUITE( SSimpleValue_Test_Suite )

BOOST_AUTO_TEST_CASE( SValueSpVectorSp_Test )
{
	//shared_ptr<vector<shared_ptr<SValue>>> v(new vector<shared_ptr<SValue>>());
	//shared_ptr<map<string, shared_ptr<SValue>>> m(new map<string, shared_ptr<SValue>>());

	//SValueSpVectorSp v(new SValueSpVector());
	//SValueSpMapSp m(new SValueSpMap());

	SValueSpVectorSp values(new SValueSpVector());

	values->push_back( SByte::Create(5) );
	values->push_back( SChar::Create('A') );
	values->push_back( SNumber::Create(10) );
	values->push_back( SString::Create("Hello") );

	BOOST_FOREACH( SValueSp value, *values )
	{
		SType type = value->GetType();

		BOOST_CHECK( value->IsSimpleType() == true );
		BOOST_CHECK( value->IsComplexType() == false );

		if (type == STypeByte  ) BOOST_CHECK( value->As<SByte>()->Get() == 5 );
		if (type == STypeChar  ) BOOST_CHECK( value->As<SChar>()->Get() == 'A' ); 
		if (type == STypeNumber) BOOST_CHECK( value->As<SNumber>()->Get() == 10 );
		if (type == STypeString) BOOST_CHECK( value->As<SString>()->Get() == "Hello" );
	}
}

BOOST_AUTO_TEST_SUITE_END()
